/* Copyright (c) 2017-2025 Li Jin <dragon-fly@qq.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */

import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';

i18n
	.use(initReactI18next)
	.init({
		resources: {
			en: {
				translation: {
					spine: {
						load: "failed to load {{file}}",
					},
					tree: {
						assets: "Workspace",
						builtin: "Built-in",
					},
					alert: {
						disconnected: "Dora SSR engine is disconnected",
						reconnecting: "Reconnecting...",
						assetLoad: "failed to load assets",
						platform: "Dora SSR is running on {{platform}}",
						getInfo: "failed to get basic info",
						builtin: "can not operate on built-in assets",
						read: "failed to read {{title}}",
						open: "failed to open files",
						unsuppored: "unsupported file {{title}}",
						reloading: "please save before reloading assets",
						reloaded: "assets reloaded",
						save: "failed to save {{title}}",
						saveCurrent: "failed to save current file",
						saving: "Saving...",
						deleteRoot: "can not delete root folder",
						deleted: "deleted {{title}}",
						delete: "failed to delete item",
						deleteNoTarget: "select a file tree node to delete",
						downloadWait: "wait for previous download to finish",
						downloadStart: "wait for download to start",
						downloadFailed: "failed to prepare download",
						renameSave: "please save all files before renaming",
						renameRoot: "can not rename root folder",
						renameFailed: "failed to rename item",
						renamed: "renamed {{oldFile}} to {{newFile}}",
						newFailed: "failed to create item",
						newNoTarget: "select a file tree node before creating new file",
						movingNoSave: "please save all files before moving",
						movingFailed: "failed to move {{from}} to folder {{to}}",
						moved: "{{from}} moved to folder {{to}}",
						stopped: "stopped running",
						stopNone: "nothing to stop",
						stopFailed: "failed to stop running",
						runNoTarget: "please select a file to run",
						run: "{{title}} is running",
						runFailed: "failed to run {{title}}",
						startUnzip: "start to unzip file {{title}}",
						doneUnzip: "finished unziping file {{title}}",
						failedUnzip: "failed to unzip file {{title}}, make sure it's a ZIP and no same named folder exist",
						failedTS: "TypeScript compile error",
						failedCompile: "failed to compile {{title}}",
						notGenerated: "code not generated for {{title}}",
						copied: "copied path {{title}}",
						copy: "failed to copy path",
						tocopy: "Relative path for {{title}}",
						build: "Built {{title}}",
						buildDone: "Build done {{title}}",
						noBuild: "Nothing to build {{title}}",
						noDeclaration: "Failed to get declaration file for {{title}}",
						waitForJob: "Please wait for current job completed",
					},
					popup: {
						goToFile: "Go to File",
						closingTab: "Closing Tab",
						closingNoSave: "close tab without saving",
						moving: "Moving Item",
						movingInfo: "move {{from}} to folder {{to}}",
					},
					upload: {
						text: "Click to select a folder or drag files to this area to upload automatically.",
						hint: "For files exceeding 500, upload as a ZIP then do decompressing instead.",
						selectFile: "Select File",
						uploading: "Uploading",
						startUpload: "Start Upload",
						success: "Upload successfully.",
						failed: "Upload failed.",
						exceeded: "Files to upload exceeded 500.",
						localFiles: "Upload Local Files",
						createTextFile: "Create Text File",
						fileName: "File Name",
						fileNamePlaceholder: "Enter file name...",
						textContent: "Text Content",
						textContentPlaceholder: "Enter or paste text content here...",
						createFile: "Create File",
						creating: "Creating...",
						textFileCreated: "Text file created successfully.",
						textFileCreationFailed: "Failed to create text file.",
						textContentRequired: "Please enter text content",
						textFileNameRequired: "Please enter file name",
						uploadingFiles: "Uploading Files",
					},
					download: {
						networkResource: "Download Network Resource",
						url: "URL",
						urlPlaceholder: "Paste network resource URL here...",
						fileName: "File Name",
						fileNamePlaceholder: "Enter file name...",
						startDownload: "Start Download",
						downloading: "Downloading...",
						status: "Status",
						idle: "Ready",
						completed: "Completed",
						failed: "Failed",
						error: "Error",
						urlRequired: "Please enter URL",
						fileNameRequired: "Please enter file name",
						startFailed: "Failed to start download",
						reset: "Reset",
					},
					action: {
						"ok": "OK",
						"cancel": "Cancel",
						"confirm": "Confirm",
						"reload": "Reload",
						"clear": "Clear",
						"close": "Close",
						"apply": "Apply",
					},
					file: {
						new: "New File",
						newFolder: "New Folder",
						rename: "Rename",
						enterFile: "Enter a file name",
						enterFolder: "Enter a folder name",
						deleteFile: "deleting file {{name}}",
						deleteFolder: "deleting folder {{name}}",
						lua: "lightweight, high-level, multi-paradigm language",
						yuescript: "expressive, extremely concise language",
						teal: "a typed dialect of Lua",
						typescript: "a strongly typed language with better coding experience",
						xml: "write game node trees in XML format",
						markdown: "do some documentation",
						folder: "create a file folder",
						yarn: "a language for game dialogue",
						visualScript: "write game logic by connecting visual nodes together",
						blockly: "write game logic by connecting blocks together",
						wa: "a simple, reliable, statically typed WASM language",
						project: "create as {{name}} project",
					},
					editor: {
						goToDefinition: "Go to Definition",
						require: "Import This Module",
						format: "Format Code",
					},
					menu: {
						version: "Dora SSR version {{version}}",
						new: "New",
						delete: "Delete",
						rename: "Rename",
						upload: "Upload",
						download: "Download",
						save: "Save",
						saveAll: "Save All",
						close: "Close",
						closeAll: "Close All",
						closeOthers: "Close Others",
						run: "Run",
						runThis: "Run This",
						stop: "Stop",
						goToFile: "Go to File",
						extract: "Unzip",
						viewLog: "View Log",
						viewCompiled: "View {{lang}}",
						copyPath: "Copy Path",
						modKey: "Mod Key Using",
						switchTab: "Switch Tab",
						build: "Build",
						obfuscate: "Get Obfuscated",
						declaration: "Get Declaration",
					},
					log: {
						wait: "Wait for logging messages ...",
						open: "Dora SSR connected!",
						close: "Dora SSR disconnected!",
						command: "Commandline"
					},
					pro: {
						basic: "Basic",
						time: "Time",
						object: "Object",
						memory: "Memory",
						renderer: "Renderer",
						multiThreaded: "Multi-threaded",
						backBuffer: "Back Buffer",
						drawCall: "Draw Calls",
						tri: "Triangles",
						line: "Lines",
						visualSize: "Visual Size",
						vSync: "VSync",
						fpsLimited: "FPS Limited",
						fps: "FPS",
						currentFPS: "Current FPS",
						fixedFPS: "Fixed FPS",
						avgCPU: "AVG CPU",
						avgGPU: "AVG GPU",
						cppObject: "C++ Objects",
						luaObject: "Lua Objects",
						luaCallback: "Lua Callbacks",
						textures: "Textures",
						fonts: "Fonts",
						audios: "Audios",
						memoryPool: "Memory Pool",
						luaMemory: "Lua Memory",
						tealMemory: "Teal Memory",
						wasmMemory: "WASM Memory",
						textureMemory: "Texture Size",
						fontMemory: "Font Size",
						audioMemory: "Audio Size",
						frameTimePeaks: "Frame Time Peaks (ms/s)",
						cpuTimePercent: "CPU Time Percent (%/s)",
						loaderTimeCosts: "Loader Time Costs",
						order: "Order",
						depth: "Depth",
						module: "Module",
						rendererTip: "the current rendering graphics interface which can be OpenGL, OpenGLES, DirectX11, Metal or Vulkan",
						multiThreadedTip: "whether the current environment uses multi-threaded rendering",
						backBufferTip: "the size of the main rendering buffer, larger rendering buffer will increase GPU rendering overhead",
						drawCallTip: "the number of calls to the low-level graphics interface, including operations such as setting rendering states and transferring rendering data, a reduction of these operations can improve performance",
						triTip: "the number of triangles submitted to the GPU for rendering",
						lineTip: "the number of line segments submitted to the GPU for rendering",
						visualSizeTip: "the logical size of the graphics window currently being rendered, equals to the renderbuffer size divided by the pixel density of the display",
						vSyncTip: "vertical synchronization is used to make the GPU wait before each refresh of the display to prevent screen tearing caused by too fast graphics rendering",
						fpsLimitedTip: "FPS limiting will make engine run in a busy loop to track the  precise frame time to switch to the next frame. And this behavior can lead to 100% CPU usage. This is usually common practice on Windows PCs for better CPU usage occupation. But it also results in extra heat and power consumption",
						fpsTip: "the target frames per second the game engine is supposed to run at, only works when 'FPS Limited' is checked",
						currentFPSTip: "the passd frames in the last second",
						fixedFPSTip: "the target frame rate (in frames per second) for a fixed update mode and the fixed update will ensure a constant frame rate, and the operation handled in a fixed update can use a constant delta time value, it is used for preventing weird behavior of a physics engine or synchronizing some states via network communications",
						avgCPUTip: "average CPU time per frame in the last second",
						avgGPUTip: "average GPU time per frame in the last second",
						cppObjectTip: "the number of total existing C++ objects",
						luaObjectTip: "the number of total existing Lua references to C++ objects",
						luaCallbackTip: "the number of C++ function call objects referenced by Lua",
						texturesTip: "the number of texture objects",
						fontsTip: "the number of font files",
						audiosTip: "the number of audio files",
						memoryPoolTip: "the size of the memory pool used by the engine to frequently allocate small data objects",
						luaMemoryTip: "the size of memory allocated by the running Lua virtual machine",
						tealMemoryTip: "the size of memory allocated by the running Teal compiler",
						wasmMemoryTip: "the size of memory allocated by the running WASM virtual machine",
						textureMemoryTip: "the memory footprint used by created or loaded textures",
						fontMemoryTip: "the memory footprint used by loaded font files",
						audioMemoryTip: "the memory footprint used by loaded audio files",
					},
					blockly: {
						logic: "Logic",
						loops: "Loops",
						math: "Math",
						text: "Text",
						lists: "Lists",
						variables: "Variables",
						functions: "Functions",
						showCode: "Show Code",
						hideCode: "Hide Code",
						save: "Save",
					},
					yarn: {
						editCode: "Edit Code",
						editVisual: "Visual Edit",
					},
					markdown: {
						editText: "Edit Text",
						view: "View",
					},
				}
			},
			zh: {
				translation: {
					spine: {
						load: "加载 {{file}} 失败",
					},
					tree: {
						assets: "工作空间",
						builtin: "内置资源",
					},
					alert: {
						disconnected: "Dora SSR 引擎已断开连接",
						reconnecting: "正在重新连接...",
						assetLoad: "资源加载失败",
						platform: "Dora SSR 正运行于 {{platform}} 平台",
						getInfo: "获取基本信息失败",
						builtin: "无法操作内置资源",
						read: "读取 {{title}} 失败",
						open: "打开文件失败",
						unsuppored: "暂不支持预览文件 {{title}}",
						reloading: "请在重新加载资源之前保存",
						reloaded: "资源已重新加载",
						save: "保存 {{title}} 失败",
						saveCurrent: "保存当前文件失败",
						saving: "正在保存...",
						deleteRoot: "无法删除资源的根目录",
						deleted: "{{title}} 已删除",
						delete: "删除文件失败",
						deleteNoTarget: "请选择要删除的文件树节点",
						downloadWait: "请等待上一个下载完成",
						downloadStart: "请等待下载开始",
						downloadFailed: "下载准备失败",
						renameSave: "请在重命名之前保存所有文件",
						renameRoot: "无法重命名根目录文件夹",
						renameFailed: "重命名文件失败",
						renamed: "{{oldFile}} 已重命名为 {{newFile}}",
						newFailed: "创建文件失败",
						newNoTarget: "请选择要创建新文件的文件树节点",
						movingNoSave: "请在移动文件之前保存所有文件",
						movingFailed: "移动 {{from}} 到文件夹 {{to}} 失败",
						moved: "已移动 {{from}} 到目录 {{to}}",
						stopped: "已停止正在运行的文件或项目",
						stopNone: "没有正在运行的文件或项目",
						stopFailed: "停止运行失败",
						runNoTarget: "请选择要运行的文件或项目",
						run: "{{title}} 正在运行",
						runFailed: "运行 {{title}} 失败",
						startUnzip: "开始解压缩 {{title}}",
						doneUnzip: "完成解压缩 {{title}}",
						failedUnzip: "解压缩 {{title}} 失败，请确认为 ZIP 文件且目录下无同名文件夹",
						failedTS: "TypeScript 编译报错",
						failedCompile: "编译失败 {{title}}",
						notGenerated: "未生成代码 {{title}}",
						copied: "已复制路径 {{title}}",
						copy: "复制路径失败",
						tocopy: "{{title}} 的相对路径",
						build: "生成成功 {{title}}",
						buildDone: "编译完成 {{title}}",
						noBuild: "无可编译文件 {{title}}",
						noDeclaration: "无法提取 {{title}} 的声明文件",
						waitForJob: "请等待当前任务完成",
					},
					popup: {
						goToFile: "跳转到文件",
						closingTab: "关闭标签中",
						closingNoSave: "标签未保存，是否确认关闭",
						moving: "移动文件",
						movingInfo: "将移动 {{from}} 到目录 {{to}}",
					},
					upload: {
						text: "点击选择上传的文件夹，或拖拽文件到这里进行自动批量上传。",
						hint: "超过 500 个文件的批量上传，请上传为 ZIP 包再做解压。",
						selectFile: "选择文件",
						uploading: "上传中",
						startUpload: "开始上传",
						success: "上传成功。",
						failed: "上传失败。",
						exceeded: "批量上传文件一次不能超过 500 个。",
						localFiles: "上传本地文件",
						createTextFile: "创建文本文件",
						fileName: "文件名",
						fileNamePlaceholder: "输入文件名...",
						textContent: "文本内容",
						textContentPlaceholder: "在此输入或粘贴文本内容...",
						createFile: "创建文件",
						creating: "创建中...",
						textFileCreated: "文本文件创建成功。",
						textFileCreationFailed: "文本文件创建失败。",
						textContentRequired: "请输入文本内容",
						textFileNameRequired: "请输入文件名",
						uploadingFiles: "正在上传的文件",
					},
					download: {
						networkResource: "下载网络资源",
						url: "链接地址",
						urlPlaceholder: "在此粘贴网络资源链接...",
						fileName: "文件名",
						fileNamePlaceholder: "输入文件名...",
						startDownload: "开始下载",
						downloading: "下载中...",
						status: "状态",
						idle: "就绪",
						failed: "失败",
						completed: "完成",
						error: "错误",
						urlRequired: "请输入链接地址",
						fileNameRequired: "请输入文件名",
						startFailed: "下载启动失败",
						reset: "重置",
					},
					action: {
						"ok": "确定",
						"cancel": "取消",
						"confirm": "确认",
						"reload": "重载",
						"clear": "清空",
						"close": "关闭",
						"apply": "应用",
					},
					file: {
						new: "新建文件",
						newFolder: "新建文件夹",
						rename: "重命名",
						enterFile: "请输入文件名",
						enterFolder: "请输入文件夹名",
						deleteFile: "是否删除文件 {{name}}",
						deleteFolder: "是否删除文件夹 {{name}}",
						lua: "轻量级、高层级、多范式的编程语言",
						yuescript: "富有表达力且极为简洁的编程语言",
						teal: "静态类型的一种Lua方言编程语言",
						typescript: "提供更好编码体验的强类型编程语言",
						xml: "用标记语言来编写游戏节点树",
						markdown: "来写一些文档吧",
						folder: "创建文件夹",
						yarn: "用于编写游戏对话的语言",
						visualScript: "通过将可视化节点连接在一起来写游戏逻辑",
						blockly: "用积木块来写游戏逻辑",
						wa: "简单可靠、静态类型的 WASM 编程语言",
						project: "创建为 {{name}} 项目",
					},
					editor: {
						goToDefinition: "跳转到定义",
						require: "导入该模块",
						format: "格式化代码",
					},
					menu: {
						version: "Dora SSR 版本号 {{version}}",
						new: "新建",
						delete: "删除",
						rename: "重命名",
						upload: "上传",
						download: "下载",
						save: "保存",
						saveAll: "全部保存",
						close: "关闭",
						closeAll: "全部关闭",
						closeOthers: "关闭其它",
						run: "运行",
						runThis: "运行文件",
						stop: "停止",
						goToFile: "跳转到文件",
						extract: "解压缩",
						viewLog: "查看日志",
						viewCompiled: "查看 {{lang}}",
						copyPath: "复制路径",
						modKey: "Mod 键使用",
						switchTab: "切换标签",
						build: "编译生成",
						obfuscate: "下载混淆",
						declaration: "提取声明",
					},
					log: {
						wait: "接收日志消息中……",
						open: "Dora SSR 已连接！",
						close: "Dora SSR 断开连接！",
						command: "命令行"
					},
					pro: {
						basic: "基础",
						time: "时间",
						object: "对象",
						memory: "内存",
						renderer: "渲染器",
						multiThreaded: "多线程渲染",
						backBuffer: "渲染缓冲区",
						drawCall: "渲染调用",
						tri: "三角形",
						line: "线段",
						visualSize: "可视区尺寸",
						vSync: "垂直同步",
						fpsLimited: "限制帧数",
						fps: "目标帧数",
						currentFPS: "当前帧数",
						fixedFPS: "固定更新帧数",
						avgCPU: "平均 CPU 耗时",
						avgGPU: "平均 GPU 耗时",
						cppObject: "C++ 对象",
						luaObject: "Lua 对象",
						luaCallback: "Lua 回调",
						textures: "纹理",
						fonts: "字体",
						audios: "音频",
						memoryPool: "内存池",
						luaMemory: "Lua 内存",
						tealMemory: "Teal 内存",
						wasmMemory: "WASM 内存",
						textureMemory: "纹理内存",
						fontMemory: "字体内存",
						audioMemory: "音频内存",
						frameTimePeaks: "每秒内帧耗时峰值(ms)",
						cpuTimePercent: "每秒内 CPU 耗时占比(%)",
						loaderTimeCosts: "脚本加载耗时",
						order: "序号",
						depth: "层级",
						module: "模块名",
						rendererTip: "当前使用的渲染底层的图形接口，可能是 OpenGL、OpenGLES、DirectX11、Metal 和 Vulkan 之一",
						multiThreadedTip: "显示当前环境是否使用多线程渲染",
						backBufferTip: "主渲染缓冲区的大小，渲染缓冲区越大会越发明显的增加 GPU 渲染的开销",
						drawCallTip: "底层图形接口的调用次数，图形接口的调用，包括设置渲染状态，传输渲染数据之类的操作。这些操作调用的次数减少对改善性能会有一定的帮助",
						triTip: "当前提交到 GPU 进行渲染的三角形的数量",
						lineTip: "当前提交到 GPU 进行渲染的线段的数量",
						visualSizeTip: "当前进行渲染的图形窗口的逻辑尺寸，通常等于渲染缓冲区大小除以显示屏的像素密度",
						vSyncTip: "垂直同步用于使 GPU 将在显示屏每次刷新之前进行等待，防止图形渲染过快导致的画面撕裂的现象",
						fpsLimitedTip: "帧数限制会使引擎通过执行一个忙等待的死循环以获取更加精准的机器时间，并计算切换到下一帧的时间点。这是在 PC 机 Windows 系统上的通常做法，以提升 CPU 占用率来提升游戏的性能。但这也会导致额外的芯片热量产生和电力消耗",
						fpsTip: "游戏引擎应该运行的每秒目标帧数，仅在“限制帧数”选项被勾选时有效",
						currentFPSTip: "最近一秒内过去的游戏帧数",
						fixedFPSTip: "固定更新模式下的目标帧速率（以每秒帧数为单位），固定更新将确保更新函数以恒定的帧速率被调度，使用恒定的更新时间间隔值，用于防止物理引擎产生奇怪行为或是用于通过网络通信同步一些状态",
						avgCPUTip: "最近一秒内每帧平均 CPU 耗时",
						avgGPUTip: "最近一秒内每帧平均 GPU 耗时",
						cppObjectTip: "所有现存的 C++ 对象的数量",
						luaObjectTip: "所有现存的 Lua 引用的 C++ 对象的计数",
						luaCallbackTip: "Lua 引用的 C++ 函数对象的数量",
						texturesTip: "纹理对象的数量",
						fontsTip: "字体文件的数量",
						audiosTip: "音频文件的数量",
						memoryPoolTip: "引擎用于频繁分配小数据对象的内存池大小",
						luaMemoryTip: "正在运行 Lua 虚拟机所分配的内存大小",
						tealMemoryTip: "正在运行 Teal 编译器所分配的内存大小",
						wasmMemoryTip: "正在运行 WASM 虚拟机所分配的内存大小",
						textureMemoryTip: "引擎已创建或加载的纹理占用的内存大小",
						fontMemoryTip: "引擎已加载的字体文件占用的内存大小",
						audioMemoryTip: "引擎已加载的音频文件占用的内存大小",
					},
					blockly: {
						logic: "逻辑",
						loops: "循环",
						math: "数学",
						text: "文本",
						lists: "列表",
						variables: "变量",
						functions: "函数",
						showCode: "显示代码",
						hideCode: "隐藏代码",
						save: "保存",
					},
					yarn: {
						editCode: "编辑代码",
						editVisual: "可视化编辑",
					},
					markdown: {
						editText: "编辑文本",
						view: "查看",
					},
				}
			},
		},
		fallbackLng: 'en',
		preload: ['en', 'zh'],
		interpolation: {
			escapeValue: false,
		},
	});

export default i18n;
